package cn.csc.module.shop.dal.mysql.banner;

import cn.csc.framework.common.pojo.PageResult;
import cn.csc.framework.mybatis.core.mapper.BaseMapperX;
import cn.csc.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.csc.module.shop.controller.admin.banner.vo.ShopBannerPageReqVO;
import cn.csc.module.shop.dal.dataobject.banner.ShopBannerDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 轮播图 Mapper
 *
 * @author liuchuang
 */
@Mapper
public interface ShopBannerMapper extends BaseMapperX<ShopBannerDO> {

    default PageResult<ShopBannerDO> selectPage(ShopBannerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopBannerDO>()
                .eqIfPresent(ShopBannerDO::getTitle, reqVO.getTitle())
                .eqIfPresent(ShopBannerDO::getStatus, reqVO.getStatus())
                .orderByDesc(ShopBannerDO::getUpdateTime));
    }

}
